package com.company;

import java.util.Scanner;

public class demo35 {
    public static void main(String[] args) {
        System.out.print("输入整数:");
        Scanner s = new Scanner(System.in);
        int n = s.nextInt();
        int row = n*2-1;//行
        int onrow = row/2+1;//上行数
        int downrow = row/2;//下行数


        for (int i = 1; i <= onrow ; i++) {//打印上行数
            for (int j = 1; j <=onrow-i; j++) { //打印空格数
                System.out.print(" ");
            }
            for (int k = 1; k <= 2*i-1; k++){//打印*数
                System.out.print("*");
            }
            System.out.println();//换行
        }

        for (int i = 1; i <= downrow; i++) {//打印下行数
            for (int j = 1; j <= i; j++) {//打印空格数
                System.out.print(" ");
            }
            for (int k = row-2; k >= 2*i-1; k--) {//打印*数
                System.out.print("*");
            }
            System.out.println();//换一行
        }
    }
}
